import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    mode: 'history',
    routes: [{
        path: '/',
        component: resolve => require(['@/views/index/index'], resolve),
        children: [{
            path: '',
            component: resolve => require(['@/views/index/main'], resolve),
        },{
            path: 'admin',
            component: resolve => require(['@/views/admin'], resolve),
            meta: {
                authList: {
                    auth_page: ['admin'],
                    auth_file: ['file_export'],
                    auth_screen_shot: ['screen_shot']
                },
                authResult: {}
            }
        }
        ,{
            path: 'component',
            component: resolve => require(['@/views/component/index'], resolve),
            children: [{
                path: 'button',
                name: 'Button',
                component: resolve => require(['@/views/component/button'], resolve),
                meta: {
                    authList: {
                        auth_page: ['button']
                    },
                    authResult: {}
                }
            }]
        }
        ]
    }]
});

// children: [{
//     path: 'al-copy',
//     name: 'alCopy',
//     component: resolve => require(['@/views/components/al-copy'], resolve),
//     meta: {
//         authList: {
//             auth_page: ['al-copy'],
//             auth_delete: ['al-copy-delete'],
//             auth_add: ['al-copy-add']
//         },
//         authResult: {}
//     }
// },{
//     path: 'al-icon',
//     name: 'alIcon',
//     component: resolve => require(['@/views/components/al-icon'], resolve),
//     meta: {
//         authList: {
//             auth_page: []
//         },
//         authResult: {}
//     }
// },{
//     path: 'components',
//     name: 'components',
//     component: resolve => require(['@/views/components/components'], resolve),
//     meta: {
//         authList: {
//             auth_page: []
//         },
//         authResult: {}
//     }
// }]